﻿using Amiable.SDK.Tool.HIni;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AmiDraw.Code
{
    public class MessagesLoader
    {
        public static string MessagesPath = Path.Combine(AppContext.BaseDirectory, "Ami", "抽卡3", "触发词.ini");

        public static (string PackName, int times)? GetMessageInfo(string messgae)
        {
            IniObject ini = new IniObject(MessagesPath);
            ini.Load();

            foreach (var section in ini.Sections)
            {
                if (section.SectionName == messgae)
                {
                    return (section["包"], section["次数"].ToInt32());
                }

            }

            return null;
        }

    }

}
